﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Axis.BusinessObject.Core;
using Axis.Dao.Core;
using Axis.Web.Administrator.Global;
namespace Axis.Web.Views.Accounts
{
    public partial class Profiles : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var IsAuthenticated = false;
            var member = new CMemberList();
            if (Session["MEMBERINFO"] != null)
            {
                member = Session["MEMBERINFO"] as CMemberList;
                IsAuthenticated = member.ID != 0;
            }
            if (!IsAuthenticated)
            {
                Response.Redirect("~/Views/Home");
            }           
            if (!IsPostBack)
            {
                GetListData("Class", ddlClass);
                GetListData("MaritalStatus", ddlMaritalStatus);
                GetListData("Education", ddlEducation);
                GetListData("Job", ddlJob);
                GetListData("Province", ddlProvince);
                GetListData("Gender", ddlGender);
                GetListData("HouseholdIncome", ddlHouseHoldIncome);
                ltrGift.Text = new AccountUI().GetMemberGift();
            }

        }
        protected void GetListData(string functionCode, DropDownList ddl)
        {
            IList<CListData> list = new CCore().GetListData(functionCode);
            ddl.DataSource = list;
            ddl.DataTextField = "Name";
            ddl.DataValueField = "Value";
            ddl.DataBind();
            ///ddl.Items.Insert(0, new ListItem("","-1"));
        }

    }
}